package practise.alogrithm;

import java.util.Arrays;

public class TwoPointers {
    public static int[] removeDuplicateNumber(int[] nums){
       int end=0;
        for(int i=0,j=1;j<nums.length;){
            if(nums[i]!=nums[j]){
                  i++;
                nums[i]=nums[j];
                j++;
            }
            else{
                j++;
            }
            end = j;
        }
        return Arrays.copyOfRange(nums,0,end);
    }


}
